# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年12月13日
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
import numpy as np

fig = plt.figure()
axes3d = Axes3D(fig,auto_add_to_figure=False)
fig.add_axes(axes3d)

x = np.arange(-4.0, 4.0, 0.125)
y = np.arange(-3.0, 3.0, 0.125)
X, Y = np.meshgrid(x, y)
Z1 = np.exp(-X ** 2 - Y ** 2)
Z2 = np.exp(-(X - 1) ** 2 - (Y - 1) ** 2)
Z = (Z1 - Z2) * 2
axes3d.plot_surface(X, Y, Z, cmap=plt.get_cmap('rainbow'))
plt.show()
